#include <bits/stdc++.h>
using namespace std;

const int N = 1e7 + 10;
int n, x;
int a[N];
int l, r, sum, retl = -1, retr = -1, retlen = N;

int main() {
    cin >> n >> x;
    for(int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    while(r <= n) {
        sum += a[r];
        while(sum >= x) {
            if(r - l + 1 < retlen) {
                retl = l;
                retr = r;
                retlen = r - l + 1;
            }
            sum -= a[l++];
        }
        r++;
    }

    cout << retl << " " << retr << endl;

    return 0;
}